package com.fr.report.core.barcode.line.codebar;

import com.fr.report.core.barcode.Module;
import java.util.HashMap;
import java.util.Map;

final class ModuleFactory
{
  private static final Map SET = new HashMap();

  private static void init()
  {
    SET.put("0", new Module(new int[] { 1, 1, 1, 1, 1, 2, 2 }));
    SET.put("1", new Module(new int[] { 1, 1, 1, 1, 2, 2, 1 }));
    SET.put("2", new Module(new int[] { 1, 1, 1, 2, 1, 1, 2 }));
    SET.put("3", new Module(new int[] { 2, 2, 1, 1, 1, 1, 1 }));
    SET.put("4", new Module(new int[] { 1, 1, 2, 1, 1, 2, 1 }));
    SET.put("5", new Module(new int[] { 2, 1, 1, 1, 1, 2, 1 }));
    SET.put("6", new Module(new int[] { 1, 2, 1, 1, 1, 1, 2 }));
    SET.put("7", new Module(new int[] { 1, 2, 1, 1, 2, 1, 1 }));
    SET.put("8", new Module(new int[] { 1, 2, 2, 1, 1, 1, 1 }));
    SET.put("9", new Module(new int[] { 2, 1, 1, 2, 1, 1, 1 }));
    SET.put("-", new Module(new int[] { 1, 1, 1, 2, 2, 1, 1 }));
    SET.put("$", new Module(new int[] { 1, 1, 2, 2, 1, 1, 1 }));
    SET.put(":", new Module(new int[] { 2, 1, 1, 1, 2, 1, 2 }));
    SET.put("/", new Module(new int[] { 2, 1, 2, 1, 1, 1, 2 }));
    SET.put(".", new Module(new int[] { 2, 1, 2, 1, 2, 1, 1 }));
    SET.put("+", new Module(new int[] { 1, 1, 2, 2, 2, 2, 2 }));
    SET.put("A", new Module(new int[] { 1, 1, 2, 2, 1, 2, 1 }));
    SET.put("B", new Module(new int[] { 1, 1, 1, 2, 1, 2, 2 }));
    SET.put("C", new Module(new int[] { 1, 2, 1, 2, 1, 1, 2 }));
    SET.put("D", new Module(new int[] { 1, 1, 1, 2, 2, 2, 1 }));
  }

  public static Module getModule(String paramString)
  {
    Module localModule = null;
    localModule = (Module)SET.get(paramString);
    localModule.setSymbol(paramString);
    return localModule;
  }

  public static boolean isValid(String paramString)
  {
    return SET.containsKey(paramString);
  }

  static
  {
    init();
  }
}